#ifndef AUDIOSOURCE_H
#define AUDIOSOURCE_H

#include "core/Component.h"
#include "types/AudioClip.h"

namespace SolidityEngine{

class AudioSource : public Component
{
    bool _loop;
    bool _playonwake;
    float _volume;
    AudioClip* _clip;
    int _channel;

    public:
        AudioSource();
        virtual ~AudioSource();

        void SetLooping(bool flag);

        void SetPlayOnWake(bool flag);

        bool IsLooping();
        bool IsLooping() const;

        void Play();
        void Stop();

        void SetVolume(float volume);

        void SetAudioClip(AudioClip* clip);

        AudioClip* GetAudioClip();
        const AudioClip* GetAudioClip() const;

        bool IsPlaying();
        bool IsPlaying() const;

    private:
        virtual AudioSource* _Clone();
        void _OnStart();

};

};

#endif // AUDIOSOURCE_H
